package com.itheima.stock.pojo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@HeadRowHeight(value = 35) // 表头行高
@ContentRowHeight(value = 25) // 内容行高
@ColumnWidth(value = 50) // 列宽
public class User {
    @ExcelProperty(value = {"用户信息详情表","用户名"},index = 1)
    private String userName;
    @ExcelProperty(value = {"用户信息详情表","年龄"},index = 2)
//    @ExcelIgnore//不输出指定列
    private Integer age;
    @ExcelProperty(value = {"用户信息详情表","地址"} ,index = 4)
    private String address;
    @ExcelProperty(value = {"用户信息详情表","生日"},index = 3)
    //自定义日期输出格式  注意是 alibaba提供的注解
    @DateTimeFormat("yyy/MM/dd HH:mm")
    private Date birthday;
}
